<?php
/**
 * Product Model
 *
 * @property Item
 */
class Product extends AppModel {
/**
 * Display field
 *
 * @var string
 */
	public $displayField = 'name';

	# Validation rules.
    var $validate = array(
        'name' => array(
            'notNull' =>array(
    		   'rule' => 'notEmpty',
    		   'required' => true,
    		   'message' => 'The Items Name must not be null and it is required',
    		   'last' => true
    		)
		)
	);

    
    function getById($id = null){
        $conditions = array(
           'Product.id' => $id,
           'Product.deleted' => 'n'
        );
        # fetch the specific data from the server and retrun it.
        return  $this->find('first', array('conditions' => $conditions, 'recursive' => -1));
    }
    
   
}
